/*
 @desc: 用户中心 数据处理
 @date: 2021/12/28
 */

#import "UserViewModel.h"

@interface UserViewModel ()

@property(nonatomic,strong)NSMutableArray * mData;

@end


@implementation UserViewModel

- (void)begin:(void (^)(void))complateBlock {
    
    UserBean * ver = [UserBean new];
    ver.title = @"版本";
    ver.desc = [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"];
    
    UserBean * ths = [UserBean new];
    ths.title = @"鸣谢";
    ths.desc = @"github@whbalzac";
//    ths.url = @"https://github.com/whbalzac";
    
    [self.mData addObjectsFromArray:@[ver,ths]];
    
    complateBlock();
}

-(NSInteger )sectionCount {
    return  1;
}
-(NSInteger )cellCountFor:(NSInteger )section {
    return self.mData.count;
}
-(UserBean *)fetchCellDataWith:(NSIndexPath *)index {
    return self.mData[index.row];
}

//MARK: 懒加载
-(NSArray *)mData {
    if (nil == _mData) {
        _mData = [[NSMutableArray alloc] init];
    }
    return _mData;
}

@end
